/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pruebas;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Dell
 */
public class Pruebas {
BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in));
    int total1=0;
    int datoa, datob, datox=0;
    int total2=0;
    int total3=0;
    int y=0;
        
    void calculo() throws IOException{
        System.out.print("ingresa dato de a");
   datoa=Integer.parseInt(entrada.readLine());
   System.out.print("ingresa dato de b");
   datob=Integer.parseInt(entrada.readLine());
   System.out.print("ingresa dato de x");
   datox=Integer.parseInt(entrada.readLine());
   
   if(datox<0){
       
       total1=((10*datoa)-(2*datob));
   }else{
       System.out.println("X es mayor a 0");
   }
   if(datox>0 && datox<=20){
       
       total2=((40*datoa)-datob);
    }else
   {
       System.out.println("X es menor a 0");
   }
   if(datox>20){
       total3=((50*datoa)-(2*datob));
   }else{
       System.out.println("X es mayor a 20");
   }
   y=total1+total2+total3;
   System.out.println(y);
    }
    public static void main(String[] args) throws IOException {
        Pruebas op = new Pruebas();
   op.calculo();
        
        
       
    }
}
